/*
 * Copyright (c) 2001, 2002 Boris Pruessmann and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v0.5
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors:
 *    Boris Pruessmann - Initial implementation.
 */
package net.sourceforge.perforce.core.internal.sync;

import org.eclipse.team.core.sync.ILocalSyncElement;

/**
  * @version $Revision: 18 $
  * @author  <a href="mailto:bpruessmann@users.sourceforge.net">Boris Pruessmann</a>
  */
public class SyncStatus
{
	// ---------------------------------------------------------------------------- Public Constants
	
	/** Indicates incoming chanegs. */
	public static final int INCOMING    = ILocalSyncElement.INCOMING;
	/** Indicates conflicting changes. */
	public static final int CONFLICTING = ILocalSyncElement.CONFLICTING;
	
	// --------------------------------------------------------------------------- Private Variables
	
	/** Stores the name of the file. */
	private String filename;
	/** Stores the sync status. Can be either INCOMING or CONFLICTING. */
	private int status;
	
	// ------------------------------------------------------------------------- Public Constructors
	
	/** Constructor for SyncStatus.
	  * 	
	  * @param filename the filename.
	  * @param status the status.
	  */
	public SyncStatus(String filename, int status)
	{
		this.filename = filename;
		this.status = status;
	}	
	
	// ------------------------------------------------------------------------------ Public Methods
	
	/** Returns the stored filename.
	  * 
	  * @return the filename.
	  */
	public String getFilename()
	{
		return filename;		
	}
	
	/** Returns whether the file is a conflicting or not.
	  * 
	  * @return true if this is a conflict.
	  */
	public boolean isConflicting()
	{
		return status == CONFLICTING;
	}
}
